package com.zeroone.star.systemhome.controller.schedule;

import com.zeroone.star.project.dto.systemhome.ScheduleDTO;
import com.zeroone.star.project.systemhome.ScheduleApis;
import com.zeroone.star.project.vo.JsonVO;
import com.zeroone.star.systemhome.service.schedule.ScheduleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsProject: oa-java
 * @BelongsPackage: com.zeroone.star.systemhome.controller.schedule
 * @Author: dashuai
 * @CreateTime: 2024-11-18  20:07
 * @Description: 日程信息Controller
 * @Version: 1.0
 */
@RestController
@Api(tags = "日程信息")
@RequestMapping("/schedule")
public class ScheduleController implements ScheduleApis {
    @Resource
    private ScheduleService scheduleService;

    @ApiOperation("查询日程信息")
    @GetMapping("query-info")
    @Override
    public JsonVO<List<ScheduleDTO>> queryScheduleList(String id) {
        return JsonVO.success(scheduleService.listScheduleInfo(id));
    }

    @ApiOperation("查询日程个数")
    @GetMapping("count-number")
    @Override
    public JsonVO<Integer> CountSchedule(String id) {
        return JsonVO.success(scheduleService.countNumber(id));
    }
}
